package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查询是否关联套餐
     * @param dishIds
     * @return
     */

    List<Long> getSetmealDishByIds(List<Long> dishIds);

    /**
     * 关联套餐菜品
     * @param setmealDishList
     */
    void insertBatch(List<SetmealDish> setmealDishList);

    /**
     * 批量删除套餐菜品
     * @param setmealIds
     */
    void deleteByIds(List<Long> setmealIds);

    /**
     * 根据id查询套餐菜品
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> getById(Long id);
}
